"""个人信息相关的 Pydantic 模型（请求/响应）"""
from pydantic import BaseModel, Field
from typing import Optional


# ==================== 请求模型 ====================

class OcrRequest(BaseModel):
    """OCR 识别请求"""
    picurl: str = Field(..., description="图片 URL 地址")
    user_id: int = Field(..., description="用户 ID")


class IDCardInfoRequest(BaseModel):
    """身份证信息提交请求"""
    name: str = Field(..., description="姓名")
    idcard_number: str = Field(
        ..., min_length=18, max_length=18, description="身份证号码（18位）"
    )
    gender: Optional[str] = Field(None, description="性别")
    birth_date: Optional[str] = Field(None, description="出生日期")
    image_url: Optional[dict] = Field(None, description="身份证图片URL（可包含正反面）")


# 兼容旧的类名（保留以防其他地方使用）
class bdapi(BaseModel):
    """已废弃：请使用 OcrRequest"""
    picurl: str = Field(..., description="图片url")

# class push(BaseModel):
#     client_id: str = Field(..., description="客户端ID")
#     message: str = Field(..., description="推送消息")
